﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models;
namespace DAL
{
    public class GoodsClassDAL
    {
        //查寻所有信息
        public static List<GoodsClass> getAllDAL()
        {
            string sql = "select * from tb_GoodsClass";
            List<GoodsClass> list=new List<GoodsClass>();
            SqlDataReader dr = DBHelper.GetDataReader(sql);
            while (dr.Read())
            {
                GoodsClass goodsClass = new GoodsClass();
                goodsClass.tyID = dr.GetInt32(0);
                goodsClass.ClassName=dr.GetString(1);
                list.Add(goodsClass);
            }
            dr.Close();
            return list;

        }
    }
}
